import { getFabricWindow } from 'fabric';
import { parseSVGDocument } from './parseSVGDocument';

export function loadSVGFromString( string, reviver, options) {
  const parser = new (getFabricWindow().DOMParser)(),
    // should we use `image/svg+xml` here?
    doc = parser.parseFromString(string.trim(), 'text/xml');
  return parseSVGDocument(doc, reviver, options);
}
